from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route("/book_list/")
def book_list():

    book="""
        <p style="font-size:24px">请选择您需要的类型</p>
        <ul style="font-size:24px">
            
            <li><a href="/book_list/小说">小说</a></li>
            <br>
            <li><a href="/book_list/童话">童话</a></li>
             <br>
            <li><a href="/book_list/杂志">杂志</a></li>
             <br>
            <li><a href="/book_list/漫画">漫画</a></li>
             <br>
            <li><a href="/book_list/教材">教材</a></li>
        </ul>
    """
    return book


@app.route("/book_list/小说")
def books_list():
     books=[
        {"bookname": "《逍遥小神农》", "book_type": "都市生活", "author": "一把时光", "public": "小学教育出版社"},
        {"bookname": "《我的校花会武术》",   "book_type": "古武机甲", "author": "黑暗王朝", "public": "初中教育出版社"},
        {"bookname": "《别拦我，俺要做木匠》", "book_type": "都市生活", "author": "往事一杯酒", "public": "高中教育出版社"},
        {"bookname": "《重生之绝品狂少》",    "book_type": "异术超能", "author": "小妖", "public": "大学教育出版社"},
        {"bookname": "《极品豪婿》",    "book_type": "黑白两道", "author": "米粒大的猛兽", "public": "社会教育出版社"}
     ]
     return render_template("catalog_a.html",**locals())

@app.route("/book_list/童话")
def tonghua():
     books=[
        {"bookname": "《一千零一夜》", "book_type": "民间故事集", "author": "郅溥浩(译)", "public": "小学教育出版社"},
        {"bookname": "《小王子》",   "book_type": "短篇小说", "author": "安托万·德·圣·埃克苏佩里", "public": "初中教育出版社"},
        {"bookname": "《木偶奇遇记》", "book_type": "长篇小说", "author": "卡洛·科洛迪", "public": "高中教育出版社"},
        {"bookname": "《三只小猪》",    "book_type": "长篇动画", "author": "约瑟夫·雅各布斯", "public": "大学教育出版社"},
        {"bookname": "《爱丽丝梦游仙境》",    "book_type": "黑白两道", "author": "刘易斯·卡罗尔 恬力", "public": "社会教育出版社"}
     ]
     return render_template("catalog_a.html", **locals())


@app.route("/book_list/杂志")
def zazhi():
    zazhi=[
        {"bookname": "《环球科学》", "magazine": "《环球科学》杂志社", "IssueCycle": "月刊"},
        {"bookname": "《儿童文学》",   "magazine": "中国少年儿童新闻出版总社", "IssueCycle": "月刊"},
        {"bookname": "《科幻世界》", "magazine": "科幻世界译文", "IssueCycle": "月刊"},
        {"bookname": "《演讲与口才成人版》",    "magazine": "演讲与口才出版社", "IssueCycle": "半月刊"},
        {"bookname": "《读者》",    "magazine": "读者出版社", "IssueCycle": "半月刊"}
     ]
    return render_template("catalog_c.html", **locals())


@app.route("/book_list/漫画")
def manhua():
     books=[
        {"bookname": "《妖神记》", "book_type": "热血冒险神魔", "author": "踏雪动漫", "public": "小学教育出版社"},
        {"bookname": "《逆天邪神》",   "book_type": "热血后宫玄幻", "author": "延强动漫", "public": "初中教育出版社"},
        {"bookname": "《我的守护女友》", "book_type": "热血恋爱都市动作", "author": "阅文漫画", "public": "高中教育出版社"},
        {"bookname": "《逆天剑神》",    "book_type": "玄幻古风修真", "author": "Amber漫研社", "public": "大学教育出版社"},
        {"bookname": "《神武天尊》",    "book_type": "热血玄幻修真漫改", "author": "绍兴凰漫", "public": "社会教育出版社"}
     ]
     return render_template("catalog_a.html", **locals())


@app.route("/book_list/教材")
def jiaocai():
     books=[
        {"bookname": "《教材全解》", "book_type": "初中", "author": "王海波", "public": "陕西人民出版社"},
        {"bookname": "《倍数学习法》",   "book_type": "小学", "author": "王海波", "public": "小学人民出版社"},
        {"bookname": "《曲一线》", "book_type": "高中", "author": "李浩奇", "public": "高中教育出版社"},
        {"bookname": "《小升初》",    "book_type": "小学", "author": "李浩奇", "public": "大学教育出版社"},
        {"bookname": "《王后雄》",    "book_type": "高中", "author": "李浩奇", "public": "社会教育出版社"}
     ]
     return render_template("catalog_a.html", **locals())

if __name__=='__main__':
    app.run(
        host="10.10.18.13",
        port=80,
        debug=True,
    )